package com.cneport.das.common.model.param;

import com.cneport.das.common.validate.FieldCheck;
import com.cneport.das.common.validate.FvEnum;
import com.cneport.das.common.validate.Regexs;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.xml.bind.annotation.*;
import java.io.Serializable;

/**
 * @Desc 参数服务ERP请求报文
 * @Ver 1.0
 * @Author GavinZhang
 * @Company 东方物通科技有限（北京）公司
 * @Date 2021-12-13 10:26:52
 */
@Data
@XmlAccessorType(XmlAccessType.FIELD)
@XmlRootElement(name = "ParamRequest")
public class ErpRequest implements Serializable {
    @XmlElement(name = "ParamHead")
    private GetReq getReq;

    @Data
    @AllArgsConstructor
    @NoArgsConstructor
    @XmlType
    @XmlAccessorType(XmlAccessType.FIELD)
    public static class GetReq {
        @FieldCheck(name = "全局ID", type = FvEnum.STRING, isNullable = false, length = 32)
        @XmlElement
        private String guid;
        @FieldCheck(name = "请求时间", type = FvEnum.DATE_STR, regex = Regexs.C14, isNullable = false)
        @XmlElement
        private String reqTime;
        @XmlElement
        private String paraInfo;
        @FieldCheck(name = "参数类型", type = FvEnum.STRING, isNullable = false)
        @XmlElement
        private String paraType;
        @FieldCheck(name = "公司编号", type = FvEnum.STRING, isNullable = false)
        @XmlElement
        private String copNo;
    }

}
